﻿using System;
using BPM.Foundation.PWDB;
using System.Collections.Generic;
namespace BPM.Foundation.PWService
{
    [System.ServiceModel.ServiceContract(SessionMode = System.ServiceModel.SessionMode.NotAllowed)]
    public partial interface IPowerService
    {
        [System.ServiceModel.OperationContract]
        bool TestConnect();

        [System.ServiceModel.OperationContract]
        List<SYS_Enumeration> getEnumeration(string pid);

        [System.ServiceModel.OperationContract]
        List<SYS_RegularExpression> getRegularExpression(string pid);

        [System.ServiceModel.OperationContract]
        List<PW_Department> getAllChildDepartment(string pid, string departmentNo);

        [System.ServiceModel.OperationContract]
        List<PW_Department> searchDepartment(string pid, PW_Department department, int type);

        [System.ServiceModel.OperationContract]
        List<PW_Department> getChildDepartment(string pid, string departmentNo);

        [System.ServiceModel.OperationContract]
        List<PW_Department> getDepartmentFromDuty(string pid, string dutyNo);

        [System.ServiceModel.OperationContract]
        List<PW_Department> getUserDepartment(string pid, string userNo);

        [System.ServiceModel.OperationContract]
        List<PW_Duty> getDutyFromDepartment(string pid, string departmentNo);

        [System.ServiceModel.OperationContract]
        List<PW_Duty> getDutyFromUser(string pid, string userNo);

        [System.ServiceModel.OperationContract]
        List<PW_Duty> searchDuty(string pid, PW_Duty duty, int type);

        [System.ServiceModel.OperationContract]
        List<PW_DepartmentExpansionInfo> getDepartmentExpansionInfo(string pid, string departmentNo);

        [System.ServiceModel.OperationContract]
        List<PW_DutyExpansionInfo> getDutyExpansionInfo(string pid, string dutyNo);

        [System.ServiceModel.OperationContract]
        List<PW_UserExpansionInfo> getUserExpansionInfo(string pid, string userNo);

        [System.ServiceModel.OperationContract]
        List<PW_User> getUserNoDepartment(string pid);

        [System.ServiceModel.OperationContract]
        List<PW_User> getDepartmentUser(string pid, string departmentNo);

        [System.ServiceModel.OperationContract]
        List<PW_User> searchUser(string pid, PW_User user, int type);

        [System.ServiceModel.OperationContract]
        PW_Department getParentDepartment(string pid, string departmentNo);

        [System.ServiceModel.OperationContract]
        PW_Department getDepartment(string pid, string departmentNo);

        [System.ServiceModel.OperationContract]
        PW_User getUser(string pid, string userNo);

        [System.ServiceModel.OperationContract]
        List<PW_User> getUsersByCondition(string pid, string userNo, string deptNo, string dutyNo);

        [System.ServiceModel.OperationContract]
        PW_Duty getDuty(string pid, string dutyNo);

        [System.ServiceModel.OperationContract]
        List<PW_Duty> getAllDuty();

        [System.ServiceModel.OperationContract]
        DepartmentTree getDepartmentTree(string pid, string departmentNo);

        [System.ServiceModel.OperationContract]
        PowerTree getUserPowerTree(string pid, string userNo);

        [System.ServiceModel.OperationContract]
        int? unbindDutyDepartment(string pid, string dutyNo, string departmentNo);

        [System.ServiceModel.OperationContract]
        int? unbindDutyUser(string pid, string userNo, string dutyNo, string departmentNo);

        [System.ServiceModel.OperationContract]
        int? updateDepartment(string pid, PW_Department department);

        [System.ServiceModel.OperationContract]
        int? updateDepartmentExpansionInfo(string pid, List<PW_DepartmentExpansionInfo> departmentExpansionInfo);

        [System.ServiceModel.OperationContract]
        int? updateDuty(string pid, PW_Duty duty);

        [System.ServiceModel.OperationContract]
        int? updateDutyExpansionInfo(string pid, List<PW_DutyExpansionInfo> dutyExpansionInfo);

        [System.ServiceModel.OperationContract]
        int? updateUser(string pid, PW_User user);

        [System.ServiceModel.OperationContract]
        int? updateUserExpansionInfo(string pid, List<PW_UserExpansionInfo> userExpansionInfo);

        [System.ServiceModel.OperationContract]
        int? insertDepartment(string pid, string parentDepartmentNo, PW_Department department);

        [System.ServiceModel.OperationContract]
        int? insertDuty(string pid, PW_Duty duty);

        [System.ServiceModel.OperationContract]
        int? insertUser(string pid, PW_User user);

        [System.ServiceModel.OperationContract]
        int? removeDepartment(string pid, string departmentNo);

        [System.ServiceModel.OperationContract]
        int? removeDuty(string pid, string dutyNo);

        [System.ServiceModel.OperationContract]
        int? addUserInDepartment(string pid, string userNo, string departmentNo);

        [System.ServiceModel.OperationContract]
        int? bindDutyDepartment(string pid, string dutyNo, string departmentNo);

        [System.ServiceModel.OperationContract]
        int? bindDutyUser(string pid, string userNo, string dutyNo, string departmentNo);

        [System.ServiceModel.OperationContract]
        int? deleteUserFromDepartment(string pid, string userNo, string departmentNo);


        [System.ServiceModel.OperationContract]
        List<PW_User> searchAllUser(string pid, string condition);

        [System.ServiceModel.OperationContract]
        List<PW_DutyInDepartment_V> getDutyInDepartmentView(string pid);

        [System.ServiceModel.OperationContract]
        List<PW_DutyInDepartment_VCN> getDutyInDepartmentViewCN(string pid);

        [System.ServiceModel.OperationContract]
        List<PW_DepartmentDutyUserRelation_V> getDepartmentDutyUserRelationView(string pid);

        [System.ServiceModel.OperationContract]
        List<PW_DepartmentDutyUserRelation_VCN> getDepartmentDutyUserRelationViewCN(string pid);

        [System.ServiceModel.OperationContract]
        bool? logon(string pid, string userNo, string password);

        [System.ServiceModel.OperationContract]
        string link(string data);

        [System.ServiceModel.OperationContract]
        int? removeUser(string pid, string userNo);

        [System.ServiceModel.OperationContract]
        List<PW_MenuDutyRelation> getMenuDuty(string pid, string menuNo);

        [System.ServiceModel.OperationContract]
        PW_Menu getMenuByNo(string menuNo);

        [System.ServiceModel.OperationContract]
        List<PW_Menu> getAllMenu();

        [System.ServiceModel.OperationContract]
        List<PW_Menu> getRootMenu(string userNo);
        
        [System.ServiceModel.OperationContract]
        List<PW_Menu> getChildMenuByParentMenu(string parentMenu,string userNo);

        [System.ServiceModel.OperationContract]
        List<PW_Menu> getMenuByForm(string formName);

        [System.ServiceModel.OperationContract]
        List<PW_Menu> getMenuByUserNo(string userNo);
        
        [System.ServiceModel.OperationContract]
        int? insertMenu(string pid, PW_Menu menu);

        [System.ServiceModel.OperationContract]
        int? updateMenu(string pid, PW_Menu menu);

        [System.ServiceModel.OperationContract]
        int? insertMenuDuty(Guid menuId, List<PW_MenuDutyRelation> menuDutyRelations);

        [System.ServiceModel.OperationContract]
        int? insertWfStateRelation(PW_WfStateUserRelation nodeRelation);

        [System.ServiceModel.OperationContract]
        int? updateWfStateRelation(PW_WfStateUserRelation nodeRelation);

        [System.ServiceModel.OperationContract]
        int? deleteWfStateRelation(PW_WfStateUserRelation nodeRelation);

        [System.ServiceModel.OperationContract]
        List<PW_WfStateUserRelation> getWfStateRelation(string templateID, string stateID);

        [System.ServiceModel.OperationContract]
        List<PW_WfStateUserRelation> getWfStateUser(string templateID, string stateID, string userNo);

        [System.ServiceModel.OperationContract]
        List<PW_DepartmentDutyUserRelation> getSuperiorDeptDutyFromUser(string userNo);

    }
}
